package Chapter2a;

public class StaticConstructor  extends B{

	static int x;
	
	public StaticConstructor() {

		x=3;
	}
	
	public StaticConstructor(int c) {
	this();	
		x=c;
	}
	/**
	 * 
	 * @param args
	 */
	public static void main(String[] args){
		StaticConstructor sc =  new StaticConstructor();
		sc.x=6;
		System.out.println("Value of static int:"+x);
		StaticConstructor sc2 =  new StaticConstructor(45);
		System.out.println("sc2 Value of static int:"+x);
		B b = sc;
		b.fart();
	}
	
	void fart(){
		System.out.println("sc's fart!");
	}
}

class B {
	static int x;
	B(){
		System.out.println("B constructor sValue of static int:"+x);
		x=16;
	}
	
	void fart(){
		System.out.println("B's fart!");
	}
}
